var s=new Array(2);
function geturl()
{	
	var url=window.location.href;
	
	var t=0;
	url=url.split("?")[1];
	cut=url.split("&");
	cut.forEach((each)=>{
		var d=each.split("=");
		s[t]=d[1];
		t++;
	})
	var user=JSON.parse(localStorage.getItem(s[1]));
	var table = document.getElementById("table");
	var newRow = table.insertRow(table.rows.length);
	newRow.id=user[1];
	var time = new Date();
	user[3]=user[3].toLocaleString();
	retime=user[3].split("T")[1];
	if(Number(retime.split(":")[0])>=16)
		var hour=Number(retime.split(":")[0])+8-24;
	else
		var hour=Number(retime.split(":")[0])+8;
	var minute=retime.split(":")[1];
	var second=retime.split(":")[2].split(".")[0];
	user[3]=user[3].split("T")[0]+" "+hour+":"+minute+":"+second;
	
	for(var i=1;i<=3;i++)
	{
		var cell = newRow.insertCell(i-1);
		cell.align="center";
		cell.innerHTML=user[i];
		
	}
	
	user[3]=time;
	user[6]=1;
	localStorage.setItem(s[1],JSON.stringify(user));
	
};	
function sign_out()
{
	var userinfo=JSON.parse(localStorage.getItem(s[1]));
	userinfo[6]=0;
	localStorage.setItem(s[1],JSON.stringify(userinfo));
	location.replace("log_in.html");
	window.location.href="log_in.html";
}